import 'package:seedfour/generated/json/base/json_field.dart';
import 'package:seedfour/generated/json/case_order_info_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class CaseOrderInfoEntity {
  List<LegalPerson>? caseClientList;
  List<LegalPerson>? caseOppositeList;
  List<LegalPerson>? caseThirdList;

  CaseOrderInfoEntity({
    this.caseClientList,
    this.caseOppositeList,
    this.caseThirdList,
  });

  factory CaseOrderInfoEntity.fromJson(Map<String, dynamic> json) =>
      $CaseOrderInfoEntityFromJson(json);

  Map<String, dynamic> toJson() => $CaseOrderInfoEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class LegalPerson {
  String? name;
  String? code;

  LegalPerson({this.name, this.code});

  factory LegalPerson.fromJson(Map<String, dynamic> json) =>
      $LegalPersonFromJson(json);

  Map<String, dynamic> toJson() => $LegalPersonToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
